#include <stdio.h>
#include <stdlib.h>
#include "loc.h"
#include "../l_neo/module.h"
//////////////////////////////////////////////////////////////////////////

char *Loc::toChars()
{
	OutBuffer buf;
	char *p;

	if (filename)
	{
		buf.printf("%s", filename);
	}

	if (linnum)
		buf.printf("(%d)", linnum);
	buf.writeByte(0);
	return (char *)buf.extractData();
}

Loc::Loc(P_Module *mod, unsigned linnum)
{
	this->linnum = linnum;
	this->filename = mod ? mod->srcfile->oToChars() : NULL;
}


